package com.momo.rabbitmq.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Fanout的 的接收器
 */
@Component
public class FanoutReceiver {
    /**
     * 第1个队列中的消息
     * @param msg
     */
    @RabbitListener(queues = "queues-one")
    public void handler1(String msg){
        System.out.println("handler:msg = "+ msg);
    }

    /**
     * 第2个队列中的消息
     * @param msg
     */
    @RabbitListener(queues = "queue-two")
    public void handler2(String msg){
        System.out.println("handler:msg = "+ msg);
    }



}
